home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6415 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newsfeed.internetmci.com!xmission!news
  2. From: tknarr@xmission.com   ( Todd Knarr )
  3. Newsgroups: comp.lang.c++,comp.lang.c,comp.lang
  4. Subject: Re: Undefined behavior? on type conversion, was: Re: Hungarian notation
  5. Date: 8 Feb 1996 03:53:27 GMT
  6. Organization: Chaos Central
  7. Message-ID: <4fbs3n$31f@news.xmission.com>
  8. References: <30C40F77.53B5@swsbbs.com> <4d2ok0$69s@beach.and.nl> <4er2qo$h2s@galaxy.ucr.edu> <31118641.6802368@nntp.ix.netcom.com> <4eurpq$b75@news.xmission.com> <31137427.133220928@nntp.ix.netcom.com> <4f975g$g18@news.xmission.com> <31189e62.47294315@nntp.ix.netcom.com>
  9. Reply-To: tknarr@xmission.com  ( Todd Knarr )
  10. NNTP-Posting-Host: slc81.xmission.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <31189e62.47294315@nntp.ix.netcom.com>, miker3@ix.netcom.com (Mike Rubenstein) writes:
  14. >Just as it requires a conversion to be done for (char) 256, even if
  15. >char is 8 bits.  Again, the standard says a cast does a conversion and
  16. >this is the correct syntax and valid data for the operation.  Hence a
  17. >conversion must be done.
  18.  
  19. Except that you don't have legal data. 256 is not a legal value for a
  20. char on machines with an 8-bit char. The question is whether the standard
  21. defines "result" to mean only ( essentialy ) return value or whether it
  22. includes outcomes in general.
  23.  
  24. The reference section of K&R2 isn't the standard, but it tends to use
  25. the same language as the standard and it refers to the result of / when
  26. the second operand is 0 being undefined, and I know many conforming
  27. compilers cause the program to terminate when you divide by 0, so if
  28. you're right then K&R2 and the standard use different definitions and
  29. I haven't seen that to be the case before.
  30.  
  31. --
  32. Todd Knarr : tknarr@xmission.com      |  finger for PGP public key
  33.                                       |  Member, USENET Cabal
  34.  
  35. Seriously, I don't want to die just yet.  I don't care how
  36. good-looking they are, I! don't! want! to! die!"
  37.                                         -- Megazone ( UF1 )
  38.  
  39.